package com.zone.lib.download.enums;

/**
 * @Author: pkqlqx
 * @CreateDate: 2022/1/2 20:00
 * @Description:
 */
public enum AppStatusEnum {

    DOWNLOAD_DEFAULT(0, "下载", "下载"),
    DOWNLOAD_DEFAULT_LIGHT(1, "安装","添加"),
    DOWNLOAD_CONTINUE(11, "暂停继续","暂停继续"),
    DOWNLOAD_WAIT(12, "等待下载","等待下载"),
    DOWNLOAD_PREPARE(13, "准备下载","下载中"),
    DOWNLOAD_LOADING(14, "下载中","暂停"),
    DOWNLOAD_PAUSE(15, "暂停下载","继续"),
    DOWNLOAD_COMPLETE(16, "下载完成","等待安装"),
    DOWNLOAD_FAIL(17, "下载失败","重新下载"),
    DOWNLOAD_DELETE(18, "取消下载","下载"),
    DOWNLOAD_NEED_PAY(19, "付费", "付费"),
    DOWNLOAD_PAYING(20, "支付中","支付中"),
    DOWNLOAD_PAYED(21, "支付失败", "支付失败"),

    INSTALL_WAIT(22, "等待安装","等待安装"),
    INSTALL_PREPARE(23, "准备安装","安装中"),
    INSTALL_LOADING(24, "安装中","安装中"),
    INSTALL_PAUSE(25, "暂停安装","继续"),
    INSTALL_SUCCESS(26, "安装成功","打开"),
    INSTALL_FAIL(27, "安装失败","重新安装"),

    UNINSTALL_APP_AND_LIGHT(30, "卸载","卸载"),
    UNINSTALL_APP(31, "卸载","卸载"),
    UNINSTALLING_APP(32, "卸载中","卸载中"),
    UNINSTALL_APP_SUCCESS(33, "卸载成功","下载"),
    UNINSTALL_APP_FAILED(34, "卸载失败","打开"),

    LIGHT_INSTALL_COMPLETE(40, "打开","打开"),
    LIGHT_INSTALL_FAIL(41, "快应用推送失败","快应用推送失败"),
    LIGHT_DELETE(42, "快应用删除","快应用删除"),
    LIGHT_DELETE_SUCCESS(43, "快应用删除成功","快应用删除成功"),
    LIGHT_DELETE_FAILED(44, "快应用删除失败","快应用删除失败"),

    UPDATE(50, "更新","更新中"),
    ;
    public int CODE;
    public String DESC;
    public String TITLE;

    AppStatusEnum(int code, String desc, String title){
        this.CODE = code;
        this.DESC = desc;
        this.TITLE = title;
    }

    public static AppStatusEnum get(int code){
        switch (code){
            case 12:
                return DOWNLOAD_WAIT;
            case 13:
                return DOWNLOAD_PREPARE;
            case 14:
                return DOWNLOAD_LOADING;
            case 15:
                return DOWNLOAD_PAUSE;
            case 16:
                return DOWNLOAD_COMPLETE;
            case 17:
                return DOWNLOAD_FAIL;
            case 18:
                return DOWNLOAD_DELETE;
            case 19:
                return DOWNLOAD_NEED_PAY;
            case 20:
                return DOWNLOAD_PAYING;
            case 21:
                return DOWNLOAD_PAYED;
            case 22:
                return INSTALL_WAIT;
            case 23:
                return INSTALL_PREPARE;
            case 24:
                return INSTALL_LOADING;
            case 25:
                return INSTALL_PAUSE;
            case 26:
                return INSTALL_SUCCESS;
            case 27:
                return INSTALL_FAIL;
            case 30:
                return UNINSTALL_APP_AND_LIGHT;
            case 31:
                return UNINSTALL_APP;
            case 32:
                return UNINSTALLING_APP;
            case 33:
                return UNINSTALL_APP_SUCCESS;
            case 34:
                return UNINSTALL_APP_FAILED;
            case 40:
                return LIGHT_INSTALL_COMPLETE;
            case 41:
                return LIGHT_INSTALL_FAIL;
            case 42:
                return LIGHT_DELETE;
            case 50:
                return UPDATE;
            case 0:
               return DOWNLOAD_DEFAULT;
        }
        return null;
    }

}
